<template>
	<view class="store-list-component">
		<view class="store-list">
			<view
				v-for="(item, index) in list"
				:key="index"
				class="store-item"
			>
				<view class="title-content">
					<view class="title">{{ item.store || '回收宝门店' }}</view>
					<view class="distance">{{ item.distances }}</view>
				</view>
				<view class="address-content">
					<view class="address-item">{{ item.addressTip }}</view>
					<view class="address-btn" @click.stop="$emit('choose-store', item)">选择门店</view>
				</view>
				<view class="open-content">营业时间：{{ item.openTime ? item.openTime : '-' }}</view>
				<view v-if="item.serviceList.length" class="tag-content">
					<view
						v-for="(child, idx) in item.serviceList"
						:key="idx"
						class="tag-item"
						:class="idx > 1 ? 'behind' : ''"
					>{{child.name}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		list: Array
	}
}
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>